#include "Esfera.h"

using namespace std;


Esfera::Esfera(Materiais *mat, Texturas *tex,float radius, int slices, int stacks) : Primitiva(mat, tex) { 

	this->radius = radius;
	this->slices = slices;
	this->stacks = stacks;

	qua = gluNewQuadric();
	gluQuadricNormals(qua, GLU_SMOOTH);
	gluQuadricDrawStyle(qua, GLU_FILL);                        
	gluQuadricOrientation(qua, GLU_OUTSIDE);
	gluQuadricTexture(qua, GL_TRUE);

}

void Esfera::aplica() {

	this->getMaterial()->aplica();
	this->getTextura()->aplica();

	gluSphere(qua, this->radius, this->slices, this->stacks);
}